package org.gwtEss.client.border;

import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Grid;
import com.google.gwt.user.client.ui.HasVerticalAlignment;
import com.google.gwt.user.client.ui.Widget;
import com.google.gwt.user.client.ui.HTMLTable.CellFormatter;

public class RoundedBorder extends Composite {
	Grid mainPanel = new Grid(3,3);
	public RoundedBorder(Widget widget) {
		CellFormatter cellFormatter = mainPanel.getCellFormatter();
		
		for (int i=0; i< 3; i++)
			for (int j=0; j< 3; j++){
				mainPanel.setText(i, j, "");
				cellFormatter.addStyleName(i, j, "border" + i + "" + j);
			}
		cellFormatter.setVerticalAlignment(1, 1, HasVerticalAlignment.ALIGN_TOP);
		
		mainPanel.setBorderWidth(0);
		mainPanel.setCellPadding(0);
		mainPanel.setCellSpacing(0);
		mainPanel.setWidget(1, 1, widget);
		mainPanel.setSize("100%", "100%");
		initWidget(mainPanel);
	}
	@Override
	public void setWidget(Widget widget) {
		mainPanel.setWidget(1, 1, widget);
	}
}
